//@author A0105730U
#include "CurrentTime.h"
// change project setting     cancel SDL check

CurrentTime::CurrentTime(void)
{
}


CurrentTime::~CurrentTime(void)
{
}

void CurrentTime::catchCurrentDT(){

	time_t t = time(0);   // get time now

/////////////////////////////////////////////////////////
//	struct tm *now = localtime( & t );
///////////////////////////////////////////////////////////
	struct tm now;
	localtime_s(&now, &t);

	char buffer[32];
	// Format: Mon, 15.06.2009 20:20:00
	std::strftime(buffer, 32, "%a %d %m %Y %H %M", &now);
	std::istringstream ss(buffer);
	ss>> day_of_week;
	ss>>day;
	ss>> month;
	ss>> year;
	ss>> hour;
	ss>> minute;
}
	


std::string CurrentTime::getCurrentDate(){
	if(day.size() == 1){
		day = "0" + day;
	}

	if(month.size() == 1){
		month = "0" + month;
	}

	return  day + "-" + month + "-" + year;
}




